package ch11.Concurrency;

/**
 * Created by 其 on 2016/4/9.
 */
public class Consumer2 implements Runnable {
    private Clerk2 clerk;

    public Consumer2(Clerk2 clerk) {
        this.clerk = clerk;
    }

    public void run() {
        System.out.println("消费者开始消耗整数......");
        for(int i = 1; i <= 10; i++) {
            try {
                clerk.getProduct();
            } catch (InterruptedException ex) {
                throw new RuntimeException(ex);
            }
        }
    }
}
